<?php

    $queryuserid = isset($_GET["userid"])?$_GET["userid"]:null;
    //error_reporting(0);
    $sql = "select * from `count` ";


    if($queryuserid){
        $sql= $sql . " WHERE userid like ('%$queryuserid%') ";
    }


    $conn = new mysqli("localhost","root","","mybolg");
    $row = [];
    $rs = $conn->query($sql);
    while($row = $rs->fetch_assoc()){
        $rows[] = $row;
    }






?>


<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
        <title></title>
    </head>
    <body>
        <h3>教职工信息</h3>

        <form action="" method="GET">
            <div>
                <label>职工号</label>
                <input type="text" name="userid" id="userid" value="<?=$queryuserid?>"/>
            </div>

            <input type="submit" name="submit" value="搜索"/>
        </form>

        <table border="4" method="GET">
            <thead>
                <tr>
                    <th>职工号</th>
                    <th>密码</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>身份证信息</th>
                    <th>学院</th>
                    <th>专业</th>
                    <th>所属班级</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach($rows as $row){?>
                <tr>
                    <td> <?=$row["userid"]?> </td>
                    <td> <?=$row["password"]?> </td>
                    <td> <?=$row["name"]?> </td>
                    <td> <?=$row["gender"]?> </td>
                    <td> <?=$row["sfzinformation"]?> </td>
                    <td> <?=$row["xy"]?> </td>
                    <td> <?=$row["zy"]?> </td>
                    <td> <?=$row["classno"]?> </td>
                </tr>
                <?php } ?>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="8">
                       
                    </td>
                </tr>
            </tfoot>
        </table>
        <a href="">修改信息</a>
    </body>
</html>